{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 基本方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "import requests\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "ip = \"http://192.168.1.111:9001\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "404\n"
     ]
    }
   ],
   "source": [
    "#获取version\n",
    "response = requests.get('http://192.168.1.111:9001/verify/face/gets?imageId=b193b8ca56024bdba3620879da6b508',headers={\"Content-Type\":\"application/json\"})\n",
    "print (response.status_code)\n",
    "# print (response.reason)\n",
    "# print(response.headers)\n",
    "# print(response.content)\n",
    "#print(response.text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"result\": \"success\", \"feature\": \"7qpXQoleAAAAAgAABjinveKczr21iZI9vpw0vRccMrw/cF67IUHIvSpooD1AuRI9GPxPvSGpRr38xoQ9yhGbvZKESb1wQtC8jnxNPfv5eT3knA89MtQ0PTSZ8zzL/Ac9de2YvFlse7poWru71zxIPP/UgjvfC0q9r+hJPZ2oRT3YRly9WlXuPR2lMjyC2Ek9O9/KPXTDmjz3BmU9u8J5OwaDDT3kkkq9LyjuPGRZsb1IC6+8imUOPb7rjb3Cume8gLXePfZVBL1Bo6K9RJZtvQVXwbxPtdW7g1sBvjVlb72Eo8Q7ncgUPYHxDL34xvm7jgJWPVOZub2GQjy8DD3svE0exzsdBJC8r4/guzcJCj0Hib485gEuvXLETL0soau8zVCyu6N9VL14z469sl6ePXhH9zw1ZYi9KBw1vSBwMz3mb+m89uehPACTJjvloD29JjSEvSrDGT1xH/o7lWtROl5WFTzPqhm9w8/TPL3srz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hvXoZ5jzq7bc8fzWQPB4ZKz1uamQ9KbsEu/lYsDupPiU9kqmxu/5T/DwvKyc9AmlHPNofCb4=\", \"rect\": [170, 57, 253, 139], \"quality\": 0.8734660744667053, \"saturation\": 91.42909646034241, \"yaw\": -4.5948872566223145, \"pitch\": 8.252676010131836, \"roll\": 12.134283065795898, \"time_used\": 82}\n"
     ]
    }
   ],
   "source": [
    "#单图特征\n",
    "def get_image_feature( target_image_path):\n",
    "        url = ip + \"/verify/feature/gets\"\n",
    "\n",
    "        files = {'imageData': open(target_image_path, 'rb')}\n",
    "        r = requests.post(url, files=files)\n",
    "          \n",
    "        return r.text\n",
    "\n",
    "print(get_image_feature( r\"C:\\Users\\user\\Pictures\\2002\\07\\19\\big\\img_18.jpg\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 多文件上传 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"result\": \"success\", \"success\": [{\"name\": \"a\", \"imageId\": \"9bf4ca0bdd0349489c16a57bc20a0e87\", \"personId\": \"9bf4ca0bdd0349489c16a57bc20a0e87\", \"feature\": \"7qpXQoleAAAAAgAAw/WnvdExyL1xNpU9D8s2vfCyl7wZ7h28uBrSvZStpj1mOSs9gzBQvf7LTb2utY09udSXve2GUL22Bwi9xnBNPTyufT0vQB09Nx4YPQNm8zzysgU9GQbGvDAQtbsHmQ28BpF9PLNVnTvMvT29u6RFPaUVSj01Xl69BrTpPaVsEjy8nEI91NLJPU10kDzsxmI9bkhgOlINFD1ES0S9BAnrPOOJsL3UCKy85d8ZPegCj70x4mG8c1LiPV5A87wdkaq9s41lvQ4Y07y4LbC6Kpf1vfKcd73saNc78+4cPfNlH734XEG8N0FjPVYJwL0Ykky8mrkJvek7LTz7/Fe8c6Ppu9by8DyAq8Q8+lo0vQyQa70q46i87JQovLlIVb1zkI+9ATyUPXL+9jysGoe9OeAwvYzRJD0upP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0zhjm99FUbPer0vzs+Wym9z0nQPdfxKL06lUe8vVkiPfXtgT1bhKE8M4QwvYmYuzxgpqc86UlqPLphFD33Qmc9I9i4u7a5WTsxfx89L1gMuh/v8jxnjTQ9WF86PPh+B74=\", \"rect\": [170, 57, 253, 139], \"quality\": 0.8734659552574158, \"yaw\": -4.594899654388428, \"pitch\": 8.252676010131836, \"roll\": 12.134283065795898, \"saturation\": 91.42909646034241}, {\"name\": \"a\", \"imageId\": \"edd740be1f1e45f08a27bc5971d27f06\", \"personId\": \"edd740be1f1e45f08a27bc5971d27f06\", \"feature\": \"7qpXQoleAAAAAgAAanKCPVQJHr04cJq75pISPLf1RTxaE6Y9lAJZPdL0P71cQ7+8EODluxGE+jwdxiU8H78FPbE3lLwU36Y8CXw+vZaLJT2suIi62F7yuivZR72WG1+8fp2YPQ/iqb00jYI9DjmDPbRwmLj9na29E+FvPYop4Dn7cZ47kp7VPRRZjL0GnG+98jhlPQ+1kb1JFgM9Woe2uzYKpbtNASo9y1ejPA95FTza4QQ8m/DovDCGmjsBb4i8iakuu9vByD3TObO8j6u0PCjYsLvxE7K8u/t3vHt/hT245fu8ZP+EOTTsPjs1zfM8N0VavRHShLzMDsw9iPs9vZ1PMTxXaq68dzyxPV5vTj03gA+98oFrvRnJNj3w5t49EB02vJE2mD2RWxa9/v3DvaSL7zwyAiy9GJkzPaw8cb1O44O9KOR7uxsNIb0Quy89k9HwvTjIoj3JoDk87xkNPIfdA70ZHM08Fz0ku1boUr2qrXm9f5S+vD8W+D1DG1Q9I22JvLTBTL23eS48Ieb4OyNtaL33f728Vx2cPF1hQD0XnES902lgPVtUADwG3ek86LqdPUAGVbwnWi0859RZPVUdAb07DIq9OiQyO0xbgDxieqI8f/dNOsGmaT1ZpNY6hJQ4vefKITyxhi29Uy2PPeDIRDwyQAI8SMCxPOP+nT3hHU09BxKNvEUhmLzji6I9cTcePXPyRD0Ocza9cWGQu64jQL30iJg9jRXVvEmpWTwluoW8+D+fPIeOVD0iHe07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HH+9i+ZvvVCeKzwVDMw9s1QvPX0c9rzvx8O88JgQPLe5Tbz/tjS9rPagO4NFDr3YPAQ9jBzDvKTHHD2QIJe7eXztPBUT5DzUG8a6ZN6Mul3xbD3PxyC844IQvbKPkrvjUJM7y71nPAN1kLz7MuU8TnOKvPJIIbuadGy7i5i4vAMN3Dxo7+A8VzDpvM1l5jv5Q1o91FUuPYjZH7xizI87dhm1PAL5LD2SVVU9Xy08vaZT6LzmYNC8A703PeTPSr1OaQQ9qEeLvNgX/TzDBdg8emgbPBXuWrwgKE69x8W/PDJEiL2yp/07U9gKPZoBcDuxR6C9HY2xvYWu8zzXC5+9uP5mO1/yPz0NfDa84vo7PVmgdz3V1iI9y4LAvG22GT0Z/xo7sIAiPZyuCT0J0Ly8kpW9PLFZcT1YbPS7+H4UvYIQTzw5JhS8gT/RPDcvzLvxCyy86DFIPMKgCT0Wezu8c05PvXCNA7yfua68mouVPXzfrTzA8kQ9BF76vGmLGz18rpy8YlJvPEOJmL0AlWw7rgu1PERehz3eWDS8XxufvIb2wzxF1Ze7AfzTvB7ZUL3ScBi9kWAuPRUvV715LNy6Kdh8vHSUYb29AK28A2FkPe5QdD01y/I8LFYCvTjE7TzEeMW6EaIHvUJvb71ef5s9a9ELvQDllbyeE7a8wIbLuSQSBD1ABSe8FbpLPZqaGTwTX8Y8i9YDvSuxoDto+za8kFywvOgjEL1ISTM9SakcvbyzhL2Lg5c9CIyMvWWaMbvtva67rUldPeOHlrxa/4m8pgxOvVBk8TwJSxA9BBTHuxpJP7xjQ8W8P1wkPe4Jn7w0uHY969dlvQYt4bxNqss7Oz5DvKLT9DwTJp494FdRvc7W5rtEEwK9SK5vPMPZ1bw=\", \"rect\": [97, 111, 235, 247], \"quality\": 0.913903534412384, \"yaw\": 7.814528465270996, \"pitch\": 2.7092883586883545, \"roll\": -2.9607326984405518, \"saturation\": 92.54492521286011}, {\"name\": \"a\", \"imageId\": \"38d6f7e7c83b415c86ee2b4626b8862e\", \"personId\": \"38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bvNqJU8iPRkPBLzujwjUpU90fLlvPYqhj1CHXA80OV1PIhQt7yiSNY8dO4kvWorwzsmGxG9nG7TPIcwED3eVZc9iPvjPNxJRzzE3Yq9knxTvCwZAL1COUS9Zv9rPQ1BAL2uWfu7YWBIvGXsbz2YyvY8EtiDuyCZ/7x2sCi9jM3qPBubZD3dlQo9X6mPvZFGmTtG0iW9b8IbvfdL7rw/5FU8188FPeBVPD3kM6g7zPgBPcxsQr2PXs28vN4fvfXUhzxLtnC8fKqQvW47o7zjqyy7fpaOPYOfBr22tLC8H1ofvbMtebwJPOe7zo0GvL+IGTxE0zM7JO8avdbNIDwoDcG9q+IJPCXD3zyR9p65lSoevQQWCD3R3rw7LZA5vVQ0yrx2SC09O9KcvP4pYjy3XRI9A2ywPEyxxzznB7O7QI14O0tptzxotMU81PlVuz+tM7ufZMY8xDZbPIWzDzyO9M68cKuHu0xombkir/O5jUw5vQ2mE73VzsS83lEZvPijCz26EM26A5nxvMGqtbza4cA82bfmvRhLgr0VYiW9Qr9UPMDK/jtz0+88xKSbO+6plTtinNY7MmtDvT/8iLynZJc8rPDHPEezEL0=\", \"rect\": [124, 176, 293, 343], \"quality\": 0.9185799956321716, \"yaw\": 3.930812120437622, \"pitch\": 10.804423332214355, \"roll\": 1.8051644563674927, \"saturation\": 95.29322385787964}], \"fail\": [], \"time_used\": 118}'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 多张特征\n",
    "def get_batch_image_features(target_image_path_list):\n",
    "        global ip\n",
    "        if target_image_path_list is None or len(target_image_path_list) == 0:\n",
    "            return None\n",
    "\n",
    "        url = ip + \"/verify/feature/batchGet\"\n",
    "        file_obj_list=[]\n",
    "      #  file_obj_list = {\"imageDatas\":(\"im1\",open(target_image_path_list[0], 'rb'))}\n",
    "       # file=open(target_image_path_list[0], 'rb')\n",
    "        for target_image_path in target_image_path_list:\n",
    "            with open(target_image_path, 'rb') as f:\n",
    "                file_obj_list.append(\n",
    "                    (\"imageDatas\",(\"a\",f.read()))\n",
    "                ) #list 法 \n",
    "                \n",
    "            \n",
    "        \n",
    "        r = requests.post(url, files=file_obj_list)\n",
    "        return r.text\n",
    "imageList=[r\"C:\\Users\\user\\Pictures\\2002\\07\\19\\big\\img_18.jpg\",r\"C:\\Users\\user\\Pictures\\2002\\07\\19\\big\\img_90.jpg\",r\"C:\\Users\\user\\Pictures\\2002\\07\\19\\big\\img_209.jpg\"]\n",
    "get_batch_image_features(imageList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"result\": \"success\", \"success\": [{\"name\": \"a\", \"imageId\": \"e9a86a4a0dfd4904a569cf2ed53548a4\", \"personId\": \"e9a86a4a0dfd4904a569cf2ed53548a4\", \"qualityScore\": 87.35, \"size\": [348.0, 450.0], \"rect\": [170, 57, 253, 139], \"yaw\": -4.594899654388428, \"pitch\": 8.252676010131836, \"roll\": 12.134283065795898, \"saturation\": 91.42909646034241}, {\"name\": \"a\", \"imageId\": \"97974f36da3540c88b2d7adceb7c2cd0\", \"personId\": \"97974f36da3540c88b2d7adceb7c2cd0\", \"qualityScore\": 91.39, \"size\": [319.0, 450.0], \"rect\": [97, 111, 235, 247], \"yaw\": 7.814528465270996, \"pitch\": 2.7092883586883545, \"roll\": -2.9607326984405518, \"saturation\": 92.54492521286011}, {\"name\": \"a\", \"imageId\": \"747c5d18860a43748f7afc4f2c75e063\", \"personId\": \"747c5d18860a43748f7afc4f2c75e063\", \"qualityScore\": 91.86, \"size\": [359.0, 450.0], \"rect\": [124, 176, 293, 343], \"yaw\": 3.930812120437622, \"pitch\": 10.804423332214355, \"roll\": 1.8051644563674927, \"saturation\": 95.29322385787964}], \"fail\": [], \"time_used\": 129}'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 多add\n",
    "data={\"dbName\":\"sj1\",\"getFeature\":1}\n",
    "def add_image (target_image_path_list):\n",
    "        global ip\n",
    "        if target_image_path_list is None or len(target_image_path_list) == 0:\n",
    "            return None\n",
    "\n",
    "        url = ip + \"/verify/face/synAdd\"\n",
    "        file_obj_list=[]\n",
    "      #  file_obj_list = {\"imageDatas\":(\"im1\",open(target_image_path_list[0], 'rb'))}\n",
    "       # file=open(target_image_path_list[0], 'rb')\n",
    "        for target_image_path in target_image_path_list:\n",
    "            with open(target_image_path, 'rb') as f:\n",
    "                file_obj_list.append(\n",
    "                    (\"imageDatas\",(\"a\",f.read()))\n",
    "                ) #list 法 \n",
    "                \n",
    "            \n",
    "        \n",
    "        r = requests.post(url ,data=data,files=file_obj_list)\n",
    "        return r.text\n",
    "imageList=[r\"C:\\Users\\user\\Pictures\\2002\\07\\19\\big\\img_18.jpg\",r\"C:\\Users\\user\\Pictures\\2002\\07\\19\\big\\img_90.jpg\",r\"C:\\Users\\user\\Pictures\\2002\\07\\19\\big\\img_209.jpg\"]\n",
    "add_image(imageList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 搜索图片\n",
    "len([None])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
